// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PyTransformAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>

// ****************************************************************************
// Module: PyTransformAttributes
//
// Purpose:
//   This class contains attributes for the transform operator.
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a TransformAttributes.
//
struct TransformAttributesObject
{
    PyObject_HEAD
    TransformAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewTransformAttributes(int);
std::string
PyTransformAttributes_ToString(const TransformAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    if(atts->GetDoRotate())
        snprintf(tmpStr, 1000, "%sdoRotate = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdoRotate = 0\n", prefix);
    str += tmpStr;
    {   const double *rotateOrigin = atts->GetRotateOrigin();
        snprintf(tmpStr, 1000, "%srotateOrigin = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", rotateOrigin[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    {   const double *rotateAxis = atts->GetRotateAxis();
        snprintf(tmpStr, 1000, "%srotateAxis = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", rotateAxis[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    snprintf(tmpStr, 1000, "%srotateAmount = %g\n", prefix, atts->GetRotateAmount());
    str += tmpStr;
    const char *rotateType_names = "Deg, Rad";
    switch (atts->GetRotateType())
    {
      case TransformAttributes::Deg:
          snprintf(tmpStr, 1000, "%srotateType = %sDeg  # %s\n", prefix, prefix, rotateType_names);
          str += tmpStr;
          break;
      case TransformAttributes::Rad:
          snprintf(tmpStr, 1000, "%srotateType = %sRad  # %s\n", prefix, prefix, rotateType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetDoScale())
        snprintf(tmpStr, 1000, "%sdoScale = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdoScale = 0\n", prefix);
    str += tmpStr;
    {   const double *scaleOrigin = atts->GetScaleOrigin();
        snprintf(tmpStr, 1000, "%sscaleOrigin = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", scaleOrigin[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    snprintf(tmpStr, 1000, "%sscaleX = %g\n", prefix, atts->GetScaleX());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sscaleY = %g\n", prefix, atts->GetScaleY());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sscaleZ = %g\n", prefix, atts->GetScaleZ());
    str += tmpStr;
    if(atts->GetDoTranslate())
        snprintf(tmpStr, 1000, "%sdoTranslate = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdoTranslate = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%stranslateX = %g\n", prefix, atts->GetTranslateX());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%stranslateY = %g\n", prefix, atts->GetTranslateY());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%stranslateZ = %g\n", prefix, atts->GetTranslateZ());
    str += tmpStr;
    const char *transformType_names = "Similarity, Coordinate, Linear";
    switch (atts->GetTransformType())
    {
      case TransformAttributes::Similarity:
          snprintf(tmpStr, 1000, "%stransformType = %sSimilarity  # %s\n", prefix, prefix, transformType_names);
          str += tmpStr;
          break;
      case TransformAttributes::Coordinate:
          snprintf(tmpStr, 1000, "%stransformType = %sCoordinate  # %s\n", prefix, prefix, transformType_names);
          str += tmpStr;
          break;
      case TransformAttributes::Linear:
          snprintf(tmpStr, 1000, "%stransformType = %sLinear  # %s\n", prefix, prefix, transformType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *inputCoordSys_names = "Cartesian, Cylindrical, Spherical";
    switch (atts->GetInputCoordSys())
    {
      case TransformAttributes::Cartesian:
          snprintf(tmpStr, 1000, "%sinputCoordSys = %sCartesian  # %s\n", prefix, prefix, inputCoordSys_names);
          str += tmpStr;
          break;
      case TransformAttributes::Cylindrical:
          snprintf(tmpStr, 1000, "%sinputCoordSys = %sCylindrical  # %s\n", prefix, prefix, inputCoordSys_names);
          str += tmpStr;
          break;
      case TransformAttributes::Spherical:
          snprintf(tmpStr, 1000, "%sinputCoordSys = %sSpherical  # %s\n", prefix, prefix, inputCoordSys_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    const char *outputCoordSys_names = "Cartesian, Cylindrical, Spherical";
    switch (atts->GetOutputCoordSys())
    {
      case TransformAttributes::Cartesian:
          snprintf(tmpStr, 1000, "%soutputCoordSys = %sCartesian  # %s\n", prefix, prefix, outputCoordSys_names);
          str += tmpStr;
          break;
      case TransformAttributes::Cylindrical:
          snprintf(tmpStr, 1000, "%soutputCoordSys = %sCylindrical  # %s\n", prefix, prefix, outputCoordSys_names);
          str += tmpStr;
          break;
      case TransformAttributes::Spherical:
          snprintf(tmpStr, 1000, "%soutputCoordSys = %sSpherical  # %s\n", prefix, prefix, outputCoordSys_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetContinuousPhi())
        snprintf(tmpStr, 1000, "%scontinuousPhi = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%scontinuousPhi = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm00 = %g\n", prefix, atts->GetM00());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm01 = %g\n", prefix, atts->GetM01());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm02 = %g\n", prefix, atts->GetM02());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm03 = %g\n", prefix, atts->GetM03());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm10 = %g\n", prefix, atts->GetM10());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm11 = %g\n", prefix, atts->GetM11());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm12 = %g\n", prefix, atts->GetM12());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm13 = %g\n", prefix, atts->GetM13());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm20 = %g\n", prefix, atts->GetM20());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm21 = %g\n", prefix, atts->GetM21());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm22 = %g\n", prefix, atts->GetM22());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm23 = %g\n", prefix, atts->GetM23());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm30 = %g\n", prefix, atts->GetM30());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm31 = %g\n", prefix, atts->GetM31());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm32 = %g\n", prefix, atts->GetM32());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sm33 = %g\n", prefix, atts->GetM33());
    str += tmpStr;
    if(atts->GetInvertLinearTransform())
        snprintf(tmpStr, 1000, "%sinvertLinearTransform = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sinvertLinearTransform = 0\n", prefix);
    str += tmpStr;
    const char *vectorTransformMethod_names = "NONE, AsPoint, AsDisplacement, AsDirection";
    switch (atts->GetVectorTransformMethod())
    {
      case TransformAttributes::None:
          snprintf(tmpStr, 1000, "%svectorTransformMethod = %sNONE  # %s\n", prefix, prefix, vectorTransformMethod_names);
          str += tmpStr;
          break;
      case TransformAttributes::AsPoint:
          snprintf(tmpStr, 1000, "%svectorTransformMethod = %sAsPoint  # %s\n", prefix, prefix, vectorTransformMethod_names);
          str += tmpStr;
          break;
      case TransformAttributes::AsDisplacement:
          snprintf(tmpStr, 1000, "%svectorTransformMethod = %sAsDisplacement  # %s\n", prefix, prefix, vectorTransformMethod_names);
          str += tmpStr;
          break;
      case TransformAttributes::AsDirection:
          snprintf(tmpStr, 1000, "%svectorTransformMethod = %sAsDirection  # %s\n", prefix, prefix, vectorTransformMethod_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetTransformVectors())
        snprintf(tmpStr, 1000, "%stransformVectors = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%stransformVectors = 0\n", prefix);
    str += tmpStr;
    return str;
}

static PyObject *
TransformAttributes_Notify(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_SetDoRotate(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the doRotate in the object.
    obj->data->SetDoRotate(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetDoRotate(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDoRotate()?1L:0L);
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetRotateOrigin(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;
    double *vals = obj->data->GetRotateOrigin();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        double cval = double(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ double", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ double", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the rotateOrigin in the object as modified.
    obj->data->SelectRotateOrigin();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetRotateOrigin(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the rotateOrigin.
    PyObject *retval = PyTuple_New(3);
    const double *rotateOrigin = obj->data->GetRotateOrigin();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(rotateOrigin[i]));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetRotateAxis(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;
    double *vals = obj->data->GetRotateAxis();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        double cval = double(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ double", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ double", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the rotateAxis in the object as modified.
    obj->data->SelectRotateAxis();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetRotateAxis(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the rotateAxis.
    PyObject *retval = PyTuple_New(3);
    const double *rotateAxis = obj->data->GetRotateAxis();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(rotateAxis[i]));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetRotateAmount(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the rotateAmount in the object.
    obj->data->SetRotateAmount(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetRotateAmount(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetRotateAmount());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetRotateType(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 2)
    {
        std::stringstream ss;
        ss << "An invalid rotateType value was given." << std::endl;
        ss << "Valid values are in the range [0,1]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Deg";
        ss << ", Rad";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the rotateType in the object.
    obj->data->SetRotateType(TransformAttributes::AngleType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetRotateType(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetRotateType()));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetDoScale(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the doScale in the object.
    obj->data->SetDoScale(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetDoScale(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDoScale()?1L:0L);
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetScaleOrigin(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;
    double *vals = obj->data->GetScaleOrigin();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        double cval = double(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ double", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ double", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the scaleOrigin in the object as modified.
    obj->data->SelectScaleOrigin();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetScaleOrigin(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the scaleOrigin.
    PyObject *retval = PyTuple_New(3);
    const double *scaleOrigin = obj->data->GetScaleOrigin();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(scaleOrigin[i]));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetScaleX(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the scaleX in the object.
    obj->data->SetScaleX(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetScaleX(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetScaleX());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetScaleY(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the scaleY in the object.
    obj->data->SetScaleY(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetScaleY(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetScaleY());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetScaleZ(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the scaleZ in the object.
    obj->data->SetScaleZ(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetScaleZ(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetScaleZ());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetDoTranslate(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the doTranslate in the object.
    obj->data->SetDoTranslate(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetDoTranslate(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDoTranslate()?1L:0L);
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetTranslateX(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the translateX in the object.
    obj->data->SetTranslateX(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetTranslateX(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetTranslateX());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetTranslateY(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the translateY in the object.
    obj->data->SetTranslateY(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetTranslateY(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetTranslateY());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetTranslateZ(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the translateZ in the object.
    obj->data->SetTranslateZ(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetTranslateZ(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetTranslateZ());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetTransformType(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid transformType value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Similarity";
        ss << ", Coordinate";
        ss << ", Linear";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the transformType in the object.
    obj->data->SetTransformType(TransformAttributes::TransformType(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetTransformType(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetTransformType()));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetInputCoordSys(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid inputCoordSys value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Cartesian";
        ss << ", Cylindrical";
        ss << ", Spherical";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the inputCoordSys in the object.
    obj->data->SetInputCoordSys(TransformAttributes::CoordinateSystem(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetInputCoordSys(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetInputCoordSys()));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetOutputCoordSys(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid outputCoordSys value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Cartesian";
        ss << ", Cylindrical";
        ss << ", Spherical";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the outputCoordSys in the object.
    obj->data->SetOutputCoordSys(TransformAttributes::CoordinateSystem(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetOutputCoordSys(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOutputCoordSys()));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetContinuousPhi(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the continuousPhi in the object.
    obj->data->SetContinuousPhi(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetContinuousPhi(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetContinuousPhi()?1L:0L);
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM00(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m00 in the object.
    obj->data->SetM00(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM00(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM00());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM01(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m01 in the object.
    obj->data->SetM01(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM01(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM01());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM02(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m02 in the object.
    obj->data->SetM02(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM02(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM02());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM03(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m03 in the object.
    obj->data->SetM03(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM03(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM03());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM10(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m10 in the object.
    obj->data->SetM10(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM10(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM10());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM11(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m11 in the object.
    obj->data->SetM11(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM11(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM11());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM12(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m12 in the object.
    obj->data->SetM12(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM12(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM12());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM13(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m13 in the object.
    obj->data->SetM13(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM13(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM13());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM20(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m20 in the object.
    obj->data->SetM20(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM20(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM20());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM21(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m21 in the object.
    obj->data->SetM21(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM21(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM21());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM22(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m22 in the object.
    obj->data->SetM22(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM22(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM22());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM23(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m23 in the object.
    obj->data->SetM23(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM23(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM23());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM30(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m30 in the object.
    obj->data->SetM30(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM30(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM30());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM31(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m31 in the object.
    obj->data->SetM31(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM31(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM31());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM32(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m32 in the object.
    obj->data->SetM32(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM32(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM32());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetM33(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the m33 in the object.
    obj->data->SetM33(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetM33(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetM33());
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetInvertLinearTransform(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the invertLinearTransform in the object.
    obj->data->SetInvertLinearTransform(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetInvertLinearTransform(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetInvertLinearTransform()?1L:0L);
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetVectorTransformMethod(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 4)
    {
        std::stringstream ss;
        ss << "An invalid vectorTransformMethod value was given." << std::endl;
        ss << "Valid values are in the range [0,3]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " None";
        ss << ", AsPoint";
        ss << ", AsDisplacement";
        ss << ", AsDirection";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the vectorTransformMethod in the object.
    obj->data->SetVectorTransformMethod(TransformAttributes::VectorTransformMethod(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetVectorTransformMethod(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetVectorTransformMethod()));
    return retval;
}

/*static*/ PyObject *
TransformAttributes_SetTransformVectors(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the transformVectors in the object.
    obj->data->SetTransformVectors(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
TransformAttributes_GetTransformVectors(PyObject *self, PyObject *args)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetTransformVectors()?1L:0L);
    return retval;
}



PyMethodDef PyTransformAttributes_methods[TRANSFORMATTRIBUTES_NMETH] = {
    {"Notify", TransformAttributes_Notify, METH_VARARGS},
    {"SetDoRotate", TransformAttributes_SetDoRotate, METH_VARARGS},
    {"GetDoRotate", TransformAttributes_GetDoRotate, METH_VARARGS},
    {"SetRotateOrigin", TransformAttributes_SetRotateOrigin, METH_VARARGS},
    {"GetRotateOrigin", TransformAttributes_GetRotateOrigin, METH_VARARGS},
    {"SetRotateAxis", TransformAttributes_SetRotateAxis, METH_VARARGS},
    {"GetRotateAxis", TransformAttributes_GetRotateAxis, METH_VARARGS},
    {"SetRotateAmount", TransformAttributes_SetRotateAmount, METH_VARARGS},
    {"GetRotateAmount", TransformAttributes_GetRotateAmount, METH_VARARGS},
    {"SetRotateType", TransformAttributes_SetRotateType, METH_VARARGS},
    {"GetRotateType", TransformAttributes_GetRotateType, METH_VARARGS},
    {"SetDoScale", TransformAttributes_SetDoScale, METH_VARARGS},
    {"GetDoScale", TransformAttributes_GetDoScale, METH_VARARGS},
    {"SetScaleOrigin", TransformAttributes_SetScaleOrigin, METH_VARARGS},
    {"GetScaleOrigin", TransformAttributes_GetScaleOrigin, METH_VARARGS},
    {"SetScaleX", TransformAttributes_SetScaleX, METH_VARARGS},
    {"GetScaleX", TransformAttributes_GetScaleX, METH_VARARGS},
    {"SetScaleY", TransformAttributes_SetScaleY, METH_VARARGS},
    {"GetScaleY", TransformAttributes_GetScaleY, METH_VARARGS},
    {"SetScaleZ", TransformAttributes_SetScaleZ, METH_VARARGS},
    {"GetScaleZ", TransformAttributes_GetScaleZ, METH_VARARGS},
    {"SetDoTranslate", TransformAttributes_SetDoTranslate, METH_VARARGS},
    {"GetDoTranslate", TransformAttributes_GetDoTranslate, METH_VARARGS},
    {"SetTranslateX", TransformAttributes_SetTranslateX, METH_VARARGS},
    {"GetTranslateX", TransformAttributes_GetTranslateX, METH_VARARGS},
    {"SetTranslateY", TransformAttributes_SetTranslateY, METH_VARARGS},
    {"GetTranslateY", TransformAttributes_GetTranslateY, METH_VARARGS},
    {"SetTranslateZ", TransformAttributes_SetTranslateZ, METH_VARARGS},
    {"GetTranslateZ", TransformAttributes_GetTranslateZ, METH_VARARGS},
    {"SetTransformType", TransformAttributes_SetTransformType, METH_VARARGS},
    {"GetTransformType", TransformAttributes_GetTransformType, METH_VARARGS},
    {"SetInputCoordSys", TransformAttributes_SetInputCoordSys, METH_VARARGS},
    {"GetInputCoordSys", TransformAttributes_GetInputCoordSys, METH_VARARGS},
    {"SetOutputCoordSys", TransformAttributes_SetOutputCoordSys, METH_VARARGS},
    {"GetOutputCoordSys", TransformAttributes_GetOutputCoordSys, METH_VARARGS},
    {"SetContinuousPhi", TransformAttributes_SetContinuousPhi, METH_VARARGS},
    {"GetContinuousPhi", TransformAttributes_GetContinuousPhi, METH_VARARGS},
    {"SetM00", TransformAttributes_SetM00, METH_VARARGS},
    {"GetM00", TransformAttributes_GetM00, METH_VARARGS},
    {"SetM01", TransformAttributes_SetM01, METH_VARARGS},
    {"GetM01", TransformAttributes_GetM01, METH_VARARGS},
    {"SetM02", TransformAttributes_SetM02, METH_VARARGS},
    {"GetM02", TransformAttributes_GetM02, METH_VARARGS},
    {"SetM03", TransformAttributes_SetM03, METH_VARARGS},
    {"GetM03", TransformAttributes_GetM03, METH_VARARGS},
    {"SetM10", TransformAttributes_SetM10, METH_VARARGS},
    {"GetM10", TransformAttributes_GetM10, METH_VARARGS},
    {"SetM11", TransformAttributes_SetM11, METH_VARARGS},
    {"GetM11", TransformAttributes_GetM11, METH_VARARGS},
    {"SetM12", TransformAttributes_SetM12, METH_VARARGS},
    {"GetM12", TransformAttributes_GetM12, METH_VARARGS},
    {"SetM13", TransformAttributes_SetM13, METH_VARARGS},
    {"GetM13", TransformAttributes_GetM13, METH_VARARGS},
    {"SetM20", TransformAttributes_SetM20, METH_VARARGS},
    {"GetM20", TransformAttributes_GetM20, METH_VARARGS},
    {"SetM21", TransformAttributes_SetM21, METH_VARARGS},
    {"GetM21", TransformAttributes_GetM21, METH_VARARGS},
    {"SetM22", TransformAttributes_SetM22, METH_VARARGS},
    {"GetM22", TransformAttributes_GetM22, METH_VARARGS},
    {"SetM23", TransformAttributes_SetM23, METH_VARARGS},
    {"GetM23", TransformAttributes_GetM23, METH_VARARGS},
    {"SetM30", TransformAttributes_SetM30, METH_VARARGS},
    {"GetM30", TransformAttributes_GetM30, METH_VARARGS},
    {"SetM31", TransformAttributes_SetM31, METH_VARARGS},
    {"GetM31", TransformAttributes_GetM31, METH_VARARGS},
    {"SetM32", TransformAttributes_SetM32, METH_VARARGS},
    {"GetM32", TransformAttributes_GetM32, METH_VARARGS},
    {"SetM33", TransformAttributes_SetM33, METH_VARARGS},
    {"GetM33", TransformAttributes_GetM33, METH_VARARGS},
    {"SetInvertLinearTransform", TransformAttributes_SetInvertLinearTransform, METH_VARARGS},
    {"GetInvertLinearTransform", TransformAttributes_GetInvertLinearTransform, METH_VARARGS},
    {"SetVectorTransformMethod", TransformAttributes_SetVectorTransformMethod, METH_VARARGS},
    {"GetVectorTransformMethod", TransformAttributes_GetVectorTransformMethod, METH_VARARGS},
    {"SetTransformVectors", TransformAttributes_SetTransformVectors, METH_VARARGS},
    {"GetTransformVectors", TransformAttributes_GetTransformVectors, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
TransformAttributes_dealloc(PyObject *v)
{
   TransformAttributesObject *obj = (TransformAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *TransformAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PyTransformAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "doRotate") == 0)
        return TransformAttributes_GetDoRotate(self, NULL);
    if(strcmp(name, "rotateOrigin") == 0)
        return TransformAttributes_GetRotateOrigin(self, NULL);
    if(strcmp(name, "rotateAxis") == 0)
        return TransformAttributes_GetRotateAxis(self, NULL);
    if(strcmp(name, "rotateAmount") == 0)
        return TransformAttributes_GetRotateAmount(self, NULL);
    if(strcmp(name, "rotateType") == 0)
        return TransformAttributes_GetRotateType(self, NULL);
    if(strcmp(name, "Deg") == 0)
        return PyInt_FromLong(long(TransformAttributes::Deg));
    if(strcmp(name, "Rad") == 0)
        return PyInt_FromLong(long(TransformAttributes::Rad));

    if(strcmp(name, "doScale") == 0)
        return TransformAttributes_GetDoScale(self, NULL);
    if(strcmp(name, "scaleOrigin") == 0)
        return TransformAttributes_GetScaleOrigin(self, NULL);
    if(strcmp(name, "scaleX") == 0)
        return TransformAttributes_GetScaleX(self, NULL);
    if(strcmp(name, "scaleY") == 0)
        return TransformAttributes_GetScaleY(self, NULL);
    if(strcmp(name, "scaleZ") == 0)
        return TransformAttributes_GetScaleZ(self, NULL);
    if(strcmp(name, "doTranslate") == 0)
        return TransformAttributes_GetDoTranslate(self, NULL);
    if(strcmp(name, "translateX") == 0)
        return TransformAttributes_GetTranslateX(self, NULL);
    if(strcmp(name, "translateY") == 0)
        return TransformAttributes_GetTranslateY(self, NULL);
    if(strcmp(name, "translateZ") == 0)
        return TransformAttributes_GetTranslateZ(self, NULL);
    if(strcmp(name, "transformType") == 0)
        return TransformAttributes_GetTransformType(self, NULL);
    if(strcmp(name, "Similarity") == 0)
        return PyInt_FromLong(long(TransformAttributes::Similarity));
    if(strcmp(name, "Coordinate") == 0)
        return PyInt_FromLong(long(TransformAttributes::Coordinate));
    if(strcmp(name, "Linear") == 0)
        return PyInt_FromLong(long(TransformAttributes::Linear));

    if(strcmp(name, "inputCoordSys") == 0)
        return TransformAttributes_GetInputCoordSys(self, NULL);
    if(strcmp(name, "Cartesian") == 0)
        return PyInt_FromLong(long(TransformAttributes::Cartesian));
    if(strcmp(name, "Cylindrical") == 0)
        return PyInt_FromLong(long(TransformAttributes::Cylindrical));
    if(strcmp(name, "Spherical") == 0)
        return PyInt_FromLong(long(TransformAttributes::Spherical));

    if(strcmp(name, "outputCoordSys") == 0)
        return TransformAttributes_GetOutputCoordSys(self, NULL);
    if(strcmp(name, "Cartesian") == 0)
        return PyInt_FromLong(long(TransformAttributes::Cartesian));
    if(strcmp(name, "Cylindrical") == 0)
        return PyInt_FromLong(long(TransformAttributes::Cylindrical));
    if(strcmp(name, "Spherical") == 0)
        return PyInt_FromLong(long(TransformAttributes::Spherical));

    if(strcmp(name, "continuousPhi") == 0)
        return TransformAttributes_GetContinuousPhi(self, NULL);
    if(strcmp(name, "m00") == 0)
        return TransformAttributes_GetM00(self, NULL);
    if(strcmp(name, "m01") == 0)
        return TransformAttributes_GetM01(self, NULL);
    if(strcmp(name, "m02") == 0)
        return TransformAttributes_GetM02(self, NULL);
    if(strcmp(name, "m03") == 0)
        return TransformAttributes_GetM03(self, NULL);
    if(strcmp(name, "m10") == 0)
        return TransformAttributes_GetM10(self, NULL);
    if(strcmp(name, "m11") == 0)
        return TransformAttributes_GetM11(self, NULL);
    if(strcmp(name, "m12") == 0)
        return TransformAttributes_GetM12(self, NULL);
    if(strcmp(name, "m13") == 0)
        return TransformAttributes_GetM13(self, NULL);
    if(strcmp(name, "m20") == 0)
        return TransformAttributes_GetM20(self, NULL);
    if(strcmp(name, "m21") == 0)
        return TransformAttributes_GetM21(self, NULL);
    if(strcmp(name, "m22") == 0)
        return TransformAttributes_GetM22(self, NULL);
    if(strcmp(name, "m23") == 0)
        return TransformAttributes_GetM23(self, NULL);
    if(strcmp(name, "m30") == 0)
        return TransformAttributes_GetM30(self, NULL);
    if(strcmp(name, "m31") == 0)
        return TransformAttributes_GetM31(self, NULL);
    if(strcmp(name, "m32") == 0)
        return TransformAttributes_GetM32(self, NULL);
    if(strcmp(name, "m33") == 0)
        return TransformAttributes_GetM33(self, NULL);
    if(strcmp(name, "invertLinearTransform") == 0)
        return TransformAttributes_GetInvertLinearTransform(self, NULL);
    if(strcmp(name, "vectorTransformMethod") == 0)
        return TransformAttributes_GetVectorTransformMethod(self, NULL);
    if(strcmp(name, "None") == 0)
        return PyInt_FromLong(long(TransformAttributes::None));
    if(strcmp(name, "NONE") == 0)
        return PyInt_FromLong(long(TransformAttributes::None));
    if(strcmp(name, "AsPoint") == 0)
        return PyInt_FromLong(long(TransformAttributes::AsPoint));
    if(strcmp(name, "AsDisplacement") == 0)
        return PyInt_FromLong(long(TransformAttributes::AsDisplacement));
    if(strcmp(name, "AsDirection") == 0)
        return PyInt_FromLong(long(TransformAttributes::AsDirection));

    if(strcmp(name, "transformVectors") == 0)
        return TransformAttributes_GetTransformVectors(self, NULL);


    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PyTransformAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PyTransformAttributes_methods[i].ml_name),
                PyString_FromString(PyTransformAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PyTransformAttributes_methods, self, name);
}

int
PyTransformAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "doRotate") == 0)
        obj = TransformAttributes_SetDoRotate(self, args);
    else if(strcmp(name, "rotateOrigin") == 0)
        obj = TransformAttributes_SetRotateOrigin(self, args);
    else if(strcmp(name, "rotateAxis") == 0)
        obj = TransformAttributes_SetRotateAxis(self, args);
    else if(strcmp(name, "rotateAmount") == 0)
        obj = TransformAttributes_SetRotateAmount(self, args);
    else if(strcmp(name, "rotateType") == 0)
        obj = TransformAttributes_SetRotateType(self, args);
    else if(strcmp(name, "doScale") == 0)
        obj = TransformAttributes_SetDoScale(self, args);
    else if(strcmp(name, "scaleOrigin") == 0)
        obj = TransformAttributes_SetScaleOrigin(self, args);
    else if(strcmp(name, "scaleX") == 0)
        obj = TransformAttributes_SetScaleX(self, args);
    else if(strcmp(name, "scaleY") == 0)
        obj = TransformAttributes_SetScaleY(self, args);
    else if(strcmp(name, "scaleZ") == 0)
        obj = TransformAttributes_SetScaleZ(self, args);
    else if(strcmp(name, "doTranslate") == 0)
        obj = TransformAttributes_SetDoTranslate(self, args);
    else if(strcmp(name, "translateX") == 0)
        obj = TransformAttributes_SetTranslateX(self, args);
    else if(strcmp(name, "translateY") == 0)
        obj = TransformAttributes_SetTranslateY(self, args);
    else if(strcmp(name, "translateZ") == 0)
        obj = TransformAttributes_SetTranslateZ(self, args);
    else if(strcmp(name, "transformType") == 0)
        obj = TransformAttributes_SetTransformType(self, args);
    else if(strcmp(name, "inputCoordSys") == 0)
        obj = TransformAttributes_SetInputCoordSys(self, args);
    else if(strcmp(name, "outputCoordSys") == 0)
        obj = TransformAttributes_SetOutputCoordSys(self, args);
    else if(strcmp(name, "continuousPhi") == 0)
        obj = TransformAttributes_SetContinuousPhi(self, args);
    else if(strcmp(name, "m00") == 0)
        obj = TransformAttributes_SetM00(self, args);
    else if(strcmp(name, "m01") == 0)
        obj = TransformAttributes_SetM01(self, args);
    else if(strcmp(name, "m02") == 0)
        obj = TransformAttributes_SetM02(self, args);
    else if(strcmp(name, "m03") == 0)
        obj = TransformAttributes_SetM03(self, args);
    else if(strcmp(name, "m10") == 0)
        obj = TransformAttributes_SetM10(self, args);
    else if(strcmp(name, "m11") == 0)
        obj = TransformAttributes_SetM11(self, args);
    else if(strcmp(name, "m12") == 0)
        obj = TransformAttributes_SetM12(self, args);
    else if(strcmp(name, "m13") == 0)
        obj = TransformAttributes_SetM13(self, args);
    else if(strcmp(name, "m20") == 0)
        obj = TransformAttributes_SetM20(self, args);
    else if(strcmp(name, "m21") == 0)
        obj = TransformAttributes_SetM21(self, args);
    else if(strcmp(name, "m22") == 0)
        obj = TransformAttributes_SetM22(self, args);
    else if(strcmp(name, "m23") == 0)
        obj = TransformAttributes_SetM23(self, args);
    else if(strcmp(name, "m30") == 0)
        obj = TransformAttributes_SetM30(self, args);
    else if(strcmp(name, "m31") == 0)
        obj = TransformAttributes_SetM31(self, args);
    else if(strcmp(name, "m32") == 0)
        obj = TransformAttributes_SetM32(self, args);
    else if(strcmp(name, "m33") == 0)
        obj = TransformAttributes_SetM33(self, args);
    else if(strcmp(name, "invertLinearTransform") == 0)
        obj = TransformAttributes_SetInvertLinearTransform(self, args);
    else if(strcmp(name, "vectorTransformMethod") == 0)
        obj = TransformAttributes_SetVectorTransformMethod(self, args);
    else if(strcmp(name, "transformVectors") == 0)
        obj = TransformAttributes_SetTransformVectors(self, args);

    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
TransformAttributes_print(PyObject *v, FILE *fp, int flags)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)v;
    fprintf(fp, "%s", PyTransformAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
TransformAttributes_str(PyObject *v)
{
    TransformAttributesObject *obj = (TransformAttributesObject *)v;
    return PyString_FromString(PyTransformAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *TransformAttributes_Purpose = "This class contains attributes for the transform operator.";
#else
static char *TransformAttributes_Purpose = "This class contains attributes for the transform operator.";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(TransformAttributesType,         \
                  "TransformAttributes",           \
                  TransformAttributesObject,       \
                  TransformAttributes_dealloc,     \
                  TransformAttributes_print,       \
                  PyTransformAttributes_getattr,   \
                  PyTransformAttributes_setattr,   \
                  TransformAttributes_str,         \
                  TransformAttributes_Purpose,     \
                  TransformAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
TransformAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &TransformAttributesType
         || Py_TYPE(other) != &TransformAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    TransformAttributes *a = ((TransformAttributesObject *)self)->data;
    TransformAttributes *b = ((TransformAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static TransformAttributes *defaultAtts = 0;
static TransformAttributes *currentAtts = 0;

static PyObject *
NewTransformAttributes(int useCurrent)
{
    TransformAttributesObject *newObject;
    newObject = PyObject_NEW(TransformAttributesObject, &TransformAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new TransformAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new TransformAttributes(*defaultAtts);
    else
        newObject->data = new TransformAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapTransformAttributes(const TransformAttributes *attr)
{
    TransformAttributesObject *newObject;
    newObject = PyObject_NEW(TransformAttributesObject, &TransformAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (TransformAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
TransformAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewTransformAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef TransformAttributesMethods[] = {
    {"TransformAttributes", TransformAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *TransformAttributesObserver = 0;

std::string
PyTransformAttributes_GetLogString()
{
    std::string s("TransformAtts = TransformAttributes()\n");
    if(currentAtts != 0)
        s += PyTransformAttributes_ToString(currentAtts, "TransformAtts.", true);
    return s;
}

static void
PyTransformAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("TransformAtts = TransformAttributes()\n");
        s += PyTransformAttributes_ToString(currentAtts, "TransformAtts.", true);
        cb(s);
    }
}

void
PyTransformAttributes_StartUp(TransformAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PyTransformAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(TransformAttributesObserver == 0)
    {
        TransformAttributesObserver = new ObserverToCallback(subj,
            PyTransformAttributes_CallLogRoutine, (void *)data);
    }

}

void
PyTransformAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete TransformAttributesObserver;
    TransformAttributesObserver = 0;
}

PyMethodDef *
PyTransformAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return TransformAttributesMethods;
}

bool
PyTransformAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &TransformAttributesType);
}

TransformAttributes *
PyTransformAttributes_FromPyObject(PyObject *obj)
{
    TransformAttributesObject *obj2 = (TransformAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PyTransformAttributes_New()
{
    return NewTransformAttributes(0);
}

PyObject *
PyTransformAttributes_Wrap(const TransformAttributes *attr)
{
    return WrapTransformAttributes(attr);
}

void
PyTransformAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    TransformAttributesObject *obj2 = (TransformAttributesObject *)obj;
    obj2->parent = parent;
}

void
PyTransformAttributes_SetDefaults(const TransformAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new TransformAttributes(*atts);
}

